home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMIBEST2.ADF
/
Best of AMICUS 2
/
PrtDrvGen2.3
/
PDG.doc
< prev
next >
Wrap
Text File
|
1987-07-22
|
10KB
|
249 lines
PrtDrvGen 2.3 / J°rgen Thomsen 25-Jun-1987
==========================================
Version 2.3 is basically identical to version 2.2. It corrects a couple of
bugs preventing the use of parameters 342 & 343 (sending a block of raw bytes
to the printer).
The PrtDrvGen and PrtDrv.lod files have been changed as well as minor changes
of the documentation.
The AssignPrt program should now always make the proper file note on the
capture file.
---------------------
The PrtDrvGen program must be run from the CLI and it will use files
located in the current directory.
There are no command line parameters for the PrtDrvGen.
The PrtDrvGen is the user interface which will generate an ASCII parameter
file used as input to the PrtDrvGen2 program, which is basically the same
program as the version 1.1 PrtDrvGen.
When the PrtDrvGen terminates it will optionally execute PrtDrvGen2. You
may run PrtDrvGen2 yourself by executing PrtDrvGen2 <printer name>, but
there should be no need for that (at least not on a 512K Amiga).
Always remember to hit RETURN after changing or entering a printer command
string. If you don't do that the changed string will not be stored.
Never embed the SPACE character in the driver name.
If you select the "Save parameters only" option when quitting the program,
the headers as well as the actual parameter strings will be written to the
".dat" file. Use this if you want to print the ".dat" file.
Compulsory parameters
=====================
The Sample.dat file contains parameters for the NEC CP6 (P6,P7,CP7,P5XL)
printers (24 pin dot matrix, color, Epson compatible).
The parameters concerning the text output of the driver are 1-3 and 6-226
(130-226 define the extended ASCII characters, which you may not need in
the first place. If not, specify zero in 130).
For text you must as a minimum set the parameters 3, 6-13, 16-17, 20-21,
24-25, 28-29, 45-46, 130. Next set 44, 58, 60, 68, 98-99, 108.
Most of the remaining parameters concern the graphics. Parameters 230-257
repeat as 258-285, 286-313 and 314-341 because of the possibility of 4
different graphics modes. In the following only reference to parameters
in the range 230-257 is made, but it applies to all four sets.
For graphics you must as a minimum set parameters 227, 230, 232, 234-239,
247, 253, but study carefully your printer manual and the parameters not
mentioned here.
Use parameter 242 (270, 298, 326) to modify the aspect ratio of the picture,
making it more or less compressed vertically.
Shareware contribution
======================
The size of the driver when loaded into memory is around 14500 bytes, which
is less than the file size displayed by the List command. This is due to the
loader information also contained in the file, but not loaded into memory.
In case you want to make a smaller driver and/or a driver without graphics,
you should use one of the special PrtDrv.lod files supplied on the
diskette you will receive upon a full shareware contribution.
PrtDrv_0.lod driver with complete functions
PrtDrv_1.lod no graphics, for daisy-wheel printers
PrtDrv_2.lod no vectorization of the picture possible
To use one of these drivers
Copy PrtDrv_n.lod To PrtDrv.lod (n = 0,1,2)
before you run the programs.
Included on this diskette are the sources for the driver, so you may modify
and optimize it especially for your printer. Also included is the source for
the AssignPRT program, the Fmt (a simple text formatter/printer command
executer e.g. "Fmt \ff" for a form feed or "Fmt \RIN" for resetting the
printer to Preferences values).
Also included is the PRoff text formatter (PD software) as well as
parameter files for several printers and a DeluxePaint template
for making very nice diskette labels (the AssignPRT command is very handy
here for printing several labels quickly). Disk space permitting other useful
PD utilities I write (or find) will be included.
The "Info" item in the pull-down menu contains my address. Please, send
only cash to my address in Denmark. My bank will charge around $10 for
clearing a foreign check.
Printer command parameters and the ^p and ^d parameters
=======================================================
The driver allows you access to 8 parameters/values accessed by a
^p or ^d parameter.
Parameters ^p0 - ^p3 (^d0 - ^d3) are the ones provided with the Amiga
printer command, if any.
Parameter ^p4 - ^p7 (^d4 - ^d7) are internal values.
These ^p and ^d parameters allow you to transfer data from
a) the standard Amiga printer commands with parameters
b) the internal variables of the driver
to the printer commands you want to send to your printer.
A simple example is the SLRM command (Set Left Right Margin):
If you want to set the margins to 5 and 75 you issue the command
ESC[5;75s
We assume, that your printer understands this command, so you would
specify the following in the SLRM command field in PrtDrvGen:
^[[^d0;^d1s
The actual string sent to the printer would be
ESC[005;075s
"^[" are just another way of specifying the ESC character
which prefixes all the Amiga printer commands.
You will notice, that the ^d0 is the first parameter in the Amiga printer
command, the ^d1 the following etc.
If you specified ^p0 and ^p1, the ^p0 would be replaced by one binary
byte of value 5 and ^p1 by one binary byte of value 75.
The value range of these parameters is 0 - 255 (one byte), but internally
in the driver they are stored as 16 bit signed integers (-32768 - 32767),
which you might be able to exploit in connection with the ^a and ^s para-
meters. The ^d parameter will consider the value an unsigned 16 bit
integer.
The parameters available for inclusion into the printer commands are
specified for each parameter in PrtDrvGen. If no parameters are mentioned
it means that the value of the "^p" and "^d" parameters are undefined for
parameters 0 - 3. The parameters 4 - 7 will have the value last stored in
them.
Use the ^f0^nnn parameter to specify the format of the string generated
by the ^d command, if the default of 3 decimal digits does not suit your
needs. To insert a 2 hexadecimal digit string use ^f0^242 (242 octal =
162 decimal, sorry about the octal, but use PrtDrvGens gadgets to
convert) to specify the base 16 two digit format.
The graphics data
=================
To clarify the parameters for storing dots in the buffer the following
figure of one pass (line) of a print head is presented:
X ->
Y 0
0 :::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::
The dots may be stored in consecutive bytes as
a) Column by column, left to right
Byte 1: [(0,0), (0,1), (0,2) .... (0,7)] Byte 2: [(1,0), (1,1)...]
b) Column by column, right to left
Byte 1: [(0,7), (0,6), (0,5) .... (0,0)] Byte 2: [(1,7), (1,6)...]
c) Row by row, left to right
Byte 1: [(0,0), (1,0), (2,0) .... (7,0)] Byte 2: [(8,0), (9,0)...]
d) Row by row, right to left
Byte 1: [(7,0), (6,0), (5,0) .... (0,0)] Byte 2: [(15,0), (14,0)...]
The parameters available for inclusion by the ^p, ^d, and ^w commands when
writing graphics are the following:
Parameter "0-1" Parameter "2-3"
[xxxxxxxx xxxxxxxx] [xxxxxxxx xxxxxxxx]
^p0 ^p1 ^p2 ^p3 binary bytes
^d0 ^d1 ^d2 ^d3 x digit bytes
^w0 ^w2 x digit words
Parameter "0-1" = ^p0 * 256 + ^p1 = ^w0
Using the driver
================
The AmigaDOS printer device code and the printer specific code (printer
drivers) will not be loaded into memory until the first output operation
to the printer is performed. You may experience, that after this load
nothing happens. This is most likely caused by the driver not getting
enough contiguous memory for its buffers or because the margins specified
in Preferences are too narrow for the picture to be printed.
The code of this driver is due to the added features larger than most
other drivers, but it will in case of memory shortage reduce its memory
requirements and execute in a slower mode. If sufficient contiguous memory
is still not available, it will print the string "No mem" on the printer
and a hexadecimal number specifying the amount of memory requested to
inform you about this.
You may avoid this by setting margins narrower with Preferences. That will
produce a smaller picture, but it will reduce the memory requirements.
You may also choose to print with less density, if your printer supports
more than a single dots-per-inch mode.
Some people claim that the PrtDrvGen driver is much slower than its
WorkBench counterparts. My own tests show it to be 1.3 times slower than
the Epson driver (120x72 DPI). This is caused by its generic nature which
prevents optimizing it for a specific printer. If you run comparison tests
then make sure that you are comparing the same dots per inch densities.
Redirection of PRT: output to file
==================================
When you use the supplied AssignPRT program to redirect PRT: output to a
file, then remember that the connection between AssignPRT and the driver
occurs when the program using the PRT: opens that device. The correct
sequence of operations would be
RUN AssignPRT PrtFile
<run your program>
The AssignPRT will no longer terminate by itself when the PRT: device is
closed, but it must be terminated by typing CTRL-C or the command
"Break 6 c" if the AssignPRT runs as CLI task 6 (see by issuing the
"Status" command).
Support
=======
I will make no promises to support the PrtDrvGen (especially not to
those people who find it proper to call me and solicit support without
submitting any Shareware contribution). However, I will do it to a certain
extent on Compuserve and Plink anyway. Until around 15-Sep-1987 I will run
a part time BBS at (918) 250-1600 0:00 AM - 7:00 AM CST and from about
15-Oct-1987 it will operate at 011-45-1-378727 5:00 PM - 0:00 AM CST.